<template>
  <nav>
    <van-nav-bar title="Alex Tools" :border="false" />
  </nav>

  <main>
    <RouterView />
  </main>

  <van-floating-bubble
    axis="xy"
    icon="wap-home-o"
    magnetic="x"
    @click="goHome"
    v-if="route.path !== '/'"
  />
</template>

<script setup>
import { RouterView, useRouter, useRoute } from 'vue-router';

const router = useRouter();
const route = useRoute();

function goHome() {
  router.push('/');
}
</script>

<style scoped>
main {
  margin-top: 8rem;
}
</style>

<!--
<template>
  <header>
    <div>
      <nav>
        <RouterLink to="/">Home</RouterLink>
        <RouterLink to="/about">About</RouterLink>
      </nav>
    </div>
  </header>

  <RouterView />
</template>
-->
